package com.habdqn.filght.information.service.impl;

import com.habdqn.filght.information.dao.FlightDao;
import com.habdqn.filght.information.dao.FlightTicketDao;
import com.habdqn.filght.information.dao.impl.FlightDaoImpl;
import com.habdqn.filght.information.dao.impl.FlightTicketDaoImpl;
import com.habdqn.filght.information.entity.Flight;
import com.habdqn.filght.information.entity.FlightTicket;
import com.habdqn.filght.information.service.FlightService;

import java.util.Date;
import java.util.List;

/**
 * @author Xing.Jiejian
 * @date 2020/11/23
 */
public class FlightServiceImpl implements FlightService {
    private FlightDao flightDao = new FlightDaoImpl();
    private FlightTicketDao flightTicketDao = new FlightTicketDaoImpl();

    @Override
    public List<Flight> find(Date date, String takeCityName, String landingCityName) {
        return flightDao.find(date,takeCityName,landingCityName);
    }

    @Override
    public List<FlightTicket> findByFlightId(int id) {
        return flightTicketDao.findByFlightId(id);
    }
}
